<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--v-...是指令，而input的type是属性-->
    <script src="../../vue.js"></script>
    <script>
        window.onload=function () {
            new Vue({
                el:'#box',
                data: {

                },
                methods:{
                    show:function () {
                        alert(1);
                    },
                    show1:function () {
                        alert(2);
                    },
                    show2:function () {
                        alert(3);
                    },
                    show3:function () {
                        alert(4);
                    }
                }
            });
        };
    </script>
</head>
<body>
<div id="box">
    <!--触发向上键-->
    <input type="text" @keyup.up="show()" title="">
    <!--触发向下键-->
    <input type="text" @keyup.down="show1()" title="">
    <!--触发向左键-->
    <input type="text" @keyup.left="show2()" title="">
    <!--触发向右键-->
    <input type="text" @keyup.right="show3()" title="">
</div>
</body>
</html>